class UrlMappings {
    static mappings = {
      //API Rest
      "/provider/buy/$code"{
          domain = "product"
          action = "buy"
	  controller = "providerBuy"
          format = "xml"
          }
      "/provider/xml/product/searchByName/$name?"{
          domain = "product"
          action = "searchByName"
	  controller = "providerBuy"
          format = "xml"
          }
      "/api/xml/$domain/$action?/$id?"{
	      controller = "rest"
          format = "xml"
	  }
      "/api/json/$domain/$action?/$id?"{
	      controller = "rest"
          format = "json"
	  }
      "/$controller/$action?/$id?"{
	      constraints {
			 // apply constraints here
		  }
	  }
      "/"(view:"/index")
	  "500"(view:'/error')
	}
}
